﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace WebChatApi.Common
{
    /// <summary>
    /// Class for console worker
    /// </summary>
    public class ConsoleWorker : IConsoleWorker
    {
        #region Properties

        /// <summary>
        /// Gets or sets the success count.
        /// </summary>
        /// <value>
        /// The success count.
        /// </value>
        public int SuccessCount { get; protected set; }

        /// <summary>
        /// Gets or sets the failed count.
        /// </summary>
        /// <value>
        /// The failed count.
        /// </value>
        public int FailedCount { get; protected set; }

        /// <summary>
        /// Gets or sets the start stamp.
        /// </summary>
        /// <value>
        /// The start stamp.
        /// </value>
        public DateTime StartStamp { get; protected set; }

        #endregion

        /// <summary>
        /// Increases the success count.
        /// </summary>
        /// <param name="value">The value.</param>
        public void IncreaseSuccessCount(int value = 1)
        {
            this.SuccessCount += value;
        }

        /// <summary>
        /// Increases the failed count.
        /// </summary>
        /// <param name="value">The value.</param>
        public void IncreaseFailedCount(int value = 1)
        {
            this.FailedCount += value;
        }

        /// <summary>
        /// Does the work.
        /// </summary>
        public virtual void DoWork()
        {
            //Do nothing here.
        }


        /// <summary>
        /// Gets the running thread count.
        /// </summary>
        /// <value>
        /// The running thread count.
        /// </value>
        public virtual int RunningThreadCount
        {
            get { return 0; }
        }
    }
}
